3.26 \(\int \cos ^6(c+d x) (a+i a \tan (c+d x))^2 \, dx\)

Optimal. Leaf size=117 \[ -\frac {i a^5}{12 d (a-i a \tan (c+d x))^3}-\frac {i a^4}{8 d (a-i a \tan (c+d x))^2}-\frac {3 i a^3}{16 d (a-i a \tan (c+d x))}+\frac {i a^3}{16 d (a+i a \tan (c+d x))}+\frac {a^2 x}{4} \]

[Out]

1/4*a^2*x-1/12*I*a^5/d/(a-I*a*tan(d*x+c))^3-1/8*I*a^4/d/(a-I*a*tan(d*x+c))^2-3/16*I*a^3/d/(a-I*a*tan(d*x+c))+1
/16*I*a^3/d/(a+I*a*tan(d*x+c))

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 117, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3487, 44, 206} \[ -\frac {i a^5}{12 d (a-i a \tan (c+d x))^3}-\frac {i a^4}{8 d (a-i a \tan (c+d x))^2}-\frac {3 i a^3}{16 d (a-i a \tan (c+d x))}+\frac {i a^3}{16 d (a+i a \tan (c+d x))}+\frac {a^2 x}{4} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^6*(a + I*a*Tan[c + d*x])^2,x]

[Out]

(a^2*x)/4 - ((I/12)*a^5)/(d*(a - I*a*Tan[c + d*x])^3) - ((I/8)*a^4)/(d*(a - I*a*Tan[c + d*x])^2) - (((3*I)/16)
*a^3)/(d*(a - I*a*Tan[c + d*x])) + ((I/16)*a^3)/(d*(a + I*a*Tan[c + d*x]))

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3487

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps

\begin {align*} \int \cos ^6(c+d x) (a+i a \tan (c+d x))^2 \, dx &=-\frac {\left (i a^7\right ) \operatorname {Subst}\left (\int \frac {1}{(a-x)^4 (a+x)^2} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {\left (i a^7\right ) \operatorname {Subst}\left (\int \left (\frac {1}{4 a^2 (a-x)^4}+\frac {1}{4 a^3 (a-x)^3}+\frac {3}{16 a^4 (a-x)^2}+\frac {1}{16 a^4 (a+x)^2}+\frac {1}{4 a^4 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {i a^5}{12 d (a-i a \tan (c+d x))^3}-\frac {i a^4}{8 d (a-i a \tan (c+d x))^2}-\frac {3 i a^3}{16 d (a-i a \tan (c+d x))}+\frac {i a^3}{16 d (a+i a \tan (c+d x))}-\frac {\left (i a^3\right ) \operatorname {Subst}\left (\int \frac {1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{4 d}\\ &=\frac {a^2 x}{4}-\frac {i a^5}{12 d (a-i a \tan (c+d x))^3}-\frac {i a^4}{8 d (a-i a \tan (c+d x))^2}-\frac {3 i a^3}{16 d (a-i a \tan (c+d x))}+\frac {i a^3}{16 d (a+i a \tan (c+d x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.55, size = 116, normalized size = 0.99 \[ \frac {a^2 (-12 i d x \sin (2 (c+d x))+3 \sin (2 (c+d x))+2 \sin (4 (c+d x))+3 (4 d x-i) \cos (2 (c+d x))+i \cos (4 (c+d x))-9 i) (\cos (2 (c+2 d x))+i \sin (2 (c+2 d x)))}{48 d (\cos (d x)+i \sin (d x))^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^6*(a + I*a*Tan[c + d*x])^2,x]

[Out]

(a^2*(-9*I + 3*(-I + 4*d*x)*Cos[2*(c + d*x)] + I*Cos[4*(c + d*x)] + 3*Sin[2*(c + d*x)] - (12*I)*d*x*Sin[2*(c +
 d*x)] + 2*Sin[4*(c + d*x)])*(Cos[2*(c + 2*d*x)] + I*Sin[2*(c + 2*d*x)]))/(48*d*(Cos[d*x] + I*Sin[d*x])^2)

________________________________________________________________________________________

fricas [A]  time = 0.62, size = 78, normalized size = 0.67 \[ \frac {{\left (24 \, a^{2} d x e^{\left (2 i \, d x + 2 i \, c\right )} - i \, a^{2} e^{\left (8 i \, d x + 8 i \, c\right )} - 6 i \, a^{2} e^{\left (6 i \, d x + 6 i \, c\right )} - 18 i \, a^{2} e^{\left (4 i \, d x + 4 i \, c\right )} + 3 i \, a^{2}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{96 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^6*(a+I*a*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

1/96*(24*a^2*d*x*e^(2*I*d*x + 2*I*c) - I*a^2*e^(8*I*d*x + 8*I*c) - 6*I*a^2*e^(6*I*d*x + 6*I*c) - 18*I*a^2*e^(4
*I*d*x + 4*I*c) + 3*I*a^2)*e^(-2*I*d*x - 2*I*c)/d

________________________________________________________________________________________

giac [A]  time = 1.11, size = 169, normalized size = 1.44 \[ \frac {96 \, a^{2} d x e^{\left (6 i \, d x + 4 i \, c\right )} + 192 \, a^{2} d x e^{\left (4 i \, d x + 2 i \, c\right )} + 96 \, a^{2} d x e^{\left (2 i \, d x\right )} - 4 i \, a^{2} e^{\left (12 i \, d x + 10 i \, c\right )} - 32 i \, a^{2} e^{\left (10 i \, d x + 8 i \, c\right )} - 124 i \, a^{2} e^{\left (8 i \, d x + 6 i \, c\right )} - 168 i \, a^{2} e^{\left (6 i \, d x + 4 i \, c\right )} - 60 i \, a^{2} e^{\left (4 i \, d x + 2 i \, c\right )} + 24 i \, a^{2} e^{\left (2 i \, d x\right )} + 12 i \, a^{2} e^{\left (-2 i \, c\right )}}{384 \, {\left (d e^{\left (6 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (4 i \, d x + 2 i \, c\right )} + d e^{\left (2 i \, d x\right )}\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^6*(a+I*a*tan(d*x+c))^2,x, algorithm="giac")

[Out]

1/384*(96*a^2*d*x*e^(6*I*d*x + 4*I*c) + 192*a^2*d*x*e^(4*I*d*x + 2*I*c) + 96*a^2*d*x*e^(2*I*d*x) - 4*I*a^2*e^(
12*I*d*x + 10*I*c) - 32*I*a^2*e^(10*I*d*x + 8*I*c) - 124*I*a^2*e^(8*I*d*x + 6*I*c) - 168*I*a^2*e^(6*I*d*x + 4*
I*c) - 60*I*a^2*e^(4*I*d*x + 2*I*c) + 24*I*a^2*e^(2*I*d*x) + 12*I*a^2*e^(-2*I*c))/(d*e^(6*I*d*x + 4*I*c) + 2*d
*e^(4*I*d*x + 2*I*c) + d*e^(2*I*d*x))

________________________________________________________________________________________

maple [A]  time = 0.52, size = 121, normalized size = 1.03 \[ \frac {-a^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{5}\left (d x +c \right )\right )}{6}+\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{24}+\frac {d x}{16}+\frac {c}{16}\right )-\frac {i a^{2} \left (\cos ^{6}\left (d x +c \right )\right )}{3}+a^{2} \left (\frac {\left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{6}+\frac {5 d x}{16}+\frac {5 c}{16}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^6*(a+I*a*tan(d*x+c))^2,x)

[Out]

1/d*(-a^2*(-1/6*sin(d*x+c)*cos(d*x+c)^5+1/24*(cos(d*x+c)^3+3/2*cos(d*x+c))*sin(d*x+c)+1/16*d*x+1/16*c)-1/3*I*a
^2*cos(d*x+c)^6+a^2*(1/6*(cos(d*x+c)^5+5/4*cos(d*x+c)^3+15/8*cos(d*x+c))*sin(d*x+c)+5/16*d*x+5/16*c))

________________________________________________________________________________________

maxima [A]  time = 0.72, size = 92, normalized size = 0.79 \[ \frac {3 \, {\left (d x + c\right )} a^{2} + \frac {3 \, a^{2} \tan \left (d x + c\right )^{5} + 8 \, a^{2} \tan \left (d x + c\right )^{3} + 9 \, a^{2} \tan \left (d x + c\right ) - 4 i \, a^{2}}{\tan \left (d x + c\right )^{6} + 3 \, \tan \left (d x + c\right )^{4} + 3 \, \tan \left (d x + c\right )^{2} + 1}}{12 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^6*(a+I*a*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

1/12*(3*(d*x + c)*a^2 + (3*a^2*tan(d*x + c)^5 + 8*a^2*tan(d*x + c)^3 + 9*a^2*tan(d*x + c) - 4*I*a^2)/(tan(d*x
+ c)^6 + 3*tan(d*x + c)^4 + 3*tan(d*x + c)^2 + 1))/d

________________________________________________________________________________________

mupad [B]  time = 3.37, size = 88, normalized size = 0.75 \[ \frac {a^2\,x}{4}+\frac {\frac {a^2\,{\mathrm {tan}\left (c+d\,x\right )}^3}{4}+\frac {a^2\,{\mathrm {tan}\left (c+d\,x\right )}^2\,1{}\mathrm {i}}{2}-\frac {a^2\,\mathrm {tan}\left (c+d\,x\right )}{12}+\frac {a^2\,1{}\mathrm {i}}{3}}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^4+{\mathrm {tan}\left (c+d\,x\right )}^3\,2{}\mathrm {i}+\mathrm {tan}\left (c+d\,x\right )\,2{}\mathrm {i}-1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^6*(a + a*tan(c + d*x)*1i)^2,x)

[Out]

(a^2*x)/4 + ((a^2*1i)/3 - (a^2*tan(c + d*x))/12 + (a^2*tan(c + d*x)^2*1i)/2 + (a^2*tan(c + d*x)^3)/4)/(d*(tan(
c + d*x)*2i + tan(c + d*x)^3*2i + tan(c + d*x)^4 - 1))

________________________________________________________________________________________

sympy [A]  time = 0.40, size = 187, normalized size = 1.60 \[ \frac {a^{2} x}{4} + \begin {cases} \frac {\left (- 8192 i a^{2} d^{3} e^{8 i c} e^{6 i d x} - 49152 i a^{2} d^{3} e^{6 i c} e^{4 i d x} - 147456 i a^{2} d^{3} e^{4 i c} e^{2 i d x} + 24576 i a^{2} d^{3} e^{- 2 i d x}\right ) e^{- 2 i c}}{786432 d^{4}} & \text {for}\: 786432 d^{4} e^{2 i c} \neq 0 \\x \left (- \frac {a^{2}}{4} + \frac {\left (a^{2} e^{8 i c} + 4 a^{2} e^{6 i c} + 6 a^{2} e^{4 i c} + 4 a^{2} e^{2 i c} + a^{2}\right ) e^{- 2 i c}}{16}\right ) & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**6*(a+I*a*tan(d*x+c))**2,x)

[Out]

a**2*x/4 + Piecewise(((-8192*I*a**2*d**3*exp(8*I*c)*exp(6*I*d*x) - 49152*I*a**2*d**3*exp(6*I*c)*exp(4*I*d*x) -
 147456*I*a**2*d**3*exp(4*I*c)*exp(2*I*d*x) + 24576*I*a**2*d**3*exp(-2*I*d*x))*exp(-2*I*c)/(786432*d**4), Ne(7
86432*d**4*exp(2*I*c), 0)), (x*(-a**2/4 + (a**2*exp(8*I*c) + 4*a**2*exp(6*I*c) + 6*a**2*exp(4*I*c) + 4*a**2*ex
p(2*I*c) + a**2)*exp(-2*I*c)/16), True))

________________________________________________________________________________________